package com.sun.stringescapeutils;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.File;
import java.io.IOException;

public class JsoupTest1 {
    public static void main(String[] args) throws IOException {
        File file = new File("F:/AnHeng/Nessus-20210331105831_5eyxtd.html");
        Document parse = Jsoup.parse(file, "utf-8","");

        /*Elements h2 = parse.getElementsByTag("h2");
        for (Element elements : h2){
            String port = elements.text();
            if (!port.equals("")){
                System.out.println(port);
            }
        }*/

        /*Elements h2 = parse.getElementsByTag("h2");
        for (Element elements : h2){
            String text = elements.text();
            if (text.contains("/")){
                System.out.println(text);
            }

        }*/


        Elements elements = parse.select("div[style=\"box-sizing: border-box; width: 100%; background: #eee; font-family: monospace; padding: 20px; margin: 5px 0 20px 0;\"]");
        for(Element element : elements){
            String text = element.text();
            System.out.println(text);
        }

       /* Elements h2 = parse.getElementsByTag("li");
        for (Element elements : h2){
            String port = elements.getElementsByTag("a").text();
            if (!port.equals("")){
                System.out.println(port);
            }

        }*/

    }
}
